package com.blindBox.front.handler.loginHandler.loginHandlerImpl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.blindBox.front.commonResult.MsgBackToFront;
import com.blindBox.front.dao_pojo.User;
import com.blindBox.front.handler.loginHandler.AbstractLoginHandler;
import com.blindBox.front.handler.mailHandler.MailHandler;
import com.blindBox.front.handler.tokenHandler.TokenHandler;
import com.blindBox.front.service.UserService;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

import java.util.Random;
import java.util.concurrent.TimeUnit;

//邮箱处理类
@Component("loginByTokeneEamil")
public class LoginByEamilHandler implements AbstractLoginHandler<MsgBackToFront>
{
    @Autowired
    private MailHandler mailHandler;

     //验证码数组
     private final Integer[] codes={1,2,3,4,5,6,7,8,9};

    @Override
    public MsgBackToFront login()
    {
        return null;
    }


    public MsgBackToFront sendCode(String email) {
     return mailHandler.sendCode(email);
    }

    public MsgBackToFront verify_eamil_login(String email, String code) {
    return mailHandler.verify_eamil_login(email,code);
    }
}
